package com.joysuch.wwyt.mh.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

public enum ExceptionHandleEnum {

    WAIT_TO_HANDLE(0, "等待处理"),
    NO_NEED_HANDLE(1, "无需处理"),
    HANDLE_ING(2, "处理中"),
    HAD_HANDLE(3, "处理完成");

    private Integer value;

    private String desc;

    ExceptionHandleEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public final Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    private static final Map<Integer, ExceptionHandleEnum> lookup = new HashMap<>();

    static {
        for (ExceptionHandleEnum e : EnumSet.allOf(ExceptionHandleEnum.class)) {
            lookup.put(e.value, e);
        }
    }

    public static ExceptionHandleEnum find(Integer value) {
        return lookup.get(value);
    }
}
